<template>
	<view class="zxc_centent">
		<view class="label">
			      <u-datetime-picker
			                :show="show"
			                v-model="value1"
			                mode="year-month"
							:formatter="formatter"
							@cancel="cancel"
							@close="cancel"
							@confirm="confirm"
			        ></u-datetime-picker>
				<view class="ike" @click="show=true">
					<text>{{time}}</text>
					<image src="../../static/images/shibottom.png" mode="widthFix" style="width:20upx;margin-left:10upx"></image>
				</view>
		</view>
		
		<!-- 数据为空 -->
		<!-- <u-empty style="margin-top:100upx;"></u-empty> -->
		
		<view class="list_view">
			<view class="list">
				<image src="../../static/images/rech.png" mode="widthFix" style="width: 80upx;"></image>
				<view class="list_right">
					<view class="list_right_sm">
						<view class="title">余额充值-1000元</view>
						<view class="num">+1100.00</view>
					</view>
					<view class="list_right_sm">
						<text>11月20日  19:15</text>
						<text>零钱余额  1200.00</text>
					</view>
				</view>
			</view>
			<view class="list">
				<image src="../../static/images/rech.png" mode="widthFix" style="width: 80upx;"></image>
				<view class="list_right">
					<view class="list_right_sm">
						<view class="title">余额充值-1000元</view>
						<view class="num">+1100.00</view>
					</view>
					<view class="list_right_sm">
						<text>11月20日  19:15</text>
						<text>零钱余额  1200.00</text>
					</view>
				</view>
			</view>
		</view>
		
	</view>
</template>

<script>
	import SOtime from '@/uni_modules/fl-SOtime/SOtime.js'
	export default {
		data (){
			return {
				time:'',
				show: false,
				value1: Number(new Date()),
			}
		},
		onShow (){
			this.time=SOtime.getDateTime()
			var timearr = this.time.replace(" ", ":").replace(/\:/g, "-").split("-");
			var timestr = timearr[0] + "-" + timearr[1]
			this.time=timestr;
		},
		methods:{
			 formatter(type, value) {
			                if (type === 'year') {
			                    return `${value}年`
			                }
			                if (type === 'month') {
			                    return `${value}月`
			                }
			                if (type === 'day') {
			                    return `${value}日`
			                }
			                return value
			            },
			cancel (){
				this.show=false;
			},
			confirm (e){
				var  Timestamp = e.value
				this.time=SOtime.timestampToDate(Timestamp)
				var timearr = this.time.replace(" ", ":").replace(/\:/g, "-").split("-");
				var timestr = timearr[0] + "-" + timearr[1]
				this.time=timestr;
				console.log(this.time)
				this.show=false;
			}
		}
	}
</script>

<style>
	.zxc_centent{
		padding:0;
	}
	.label{
		padding:30upx;
	}
	.ike{
		display: flex;
		align-items: center;
		font-weight: 700;
	}
	.list_view{
		
	}
	.list{
		width:90%;
		padding:30upx 5%;
		background-color: #fff;
		border-bottom:2upx solid #ededed;
		display: flex;
		align-items: center;
		justify-content: space-between;
	}
	.list_right{
		width:83%;
	}
	.list_right_sm{
		display: flex;
		align-items: center;
		justify-content: space-between;
		margin-bottom:10upx;
		color:#999;
		font-size:26upx;
	}
	.title{
		font-weight: 700;
		color:#000;
		font-size:30upx;
	}
	.num{
		color:#ff9140;
		font-size: 30upx;
	}
</style>